home *** CD-ROM | disk | FTP | other *** search
/ Software Explosion / Software Explosion (Fore-Matt Home Computing)(1996).iso / games / workbench / lander_2 / source / iff / 8svx.h next >
Text File  |  1996-01-01  |  2KB  |  62 lines

  1. /* 8svx.h  include file for IFF 8-bit sampled voices
  2.  *           essentially cribbed from EA IFF documentation
  3.  *           KEL 21-Feb-87
  4.  */
  5.  
  6. #define ID_8SVX MakeID('8', 'S', 'V', 'X')
  7. #define ID_VHDR MakeID('V', 'H', 'D', 'R')
  8.  
  9. typedef LONG Fixed;        /* A fixed-point value, 16 bits to the left of the
  10.                          * point and 16 to the right.  A Fixed is a number
  11.                          * of 216ths, i.e. 65536ths. */
  12.  
  13. #define Unity 0x1000L        /* Unity = Fixed 1.0 = maximum volume */
  14.  
  15. /* sCompression: Choice of compression algorithm applied to the samples */
  16.  
  17. #define sCmpNone    0        /* not compressed */
  18. #define sCmpFibDelta 1        /* Fibonacci-delta encoding */
  19. /* can be more kinds in the future */
  20.  
  21. typedef struct {
  22.     ULONG oneShotHiSamples,    /* # samples in the high octave 1-shot part */
  23.     repeatHiSamples,        /* # samples in the high octave repeat part */
  24.     samplesPerHiCycle;        /* # samples/cycle in high octave, else 0 */
  25.     UWORD samplesPerSec;    /* data sampling rate */
  26.     UBYTE ctOctave,            /* # octaves of waveforms */
  27.     sCompression;            /* data compression technique used */
  28.     Fixed volume;            /* playback volume from 0 to Unity (full
  29.                              * volume).  Map this value into the output
  30.                              * hardware's dynamic range. */
  31.     } Voice8Header;
  32.  
  33. #define ID_NAME MakeID('N', 'A', 'M', 'E')
  34.     /* NAME chunk contains a CHAR [], the voice's name. */
  35.  
  36. #define ID_Copyright MakeID('(','c',')',' ')
  37.     /* "(c) " chunk contains a CHAR [], the FORM's copyright notice. */
  38.  
  39. #define ID_AUTH MakeID('A','U','T','H')
  40.     /* AUTH chunk contains a CHAR [], the author's name. */
  41.  
  42. #define ID_ANNO MakeID('A', 'N', 'N', 'O')
  43.     /* ANNO chunk contains a CHAR [], author's text annotations. */
  44.  
  45. #define ID_ATAK MakeID('A', 'T', 'A', 'K')
  46. #define ID_RLSE MakeID('R', 'L', 'S', 'E')
  47.  
  48. typedef struct {
  49.     UWORD duration;        /* segment duration in milliseconds, > 0 */
  50.     Fixed dest;            /* destination volume factor */
  51.     } EGPoint;
  52.  
  53. /* ATAK and RLSE chunks contain an EGPoint[] piecewise-linear envelope. */
  54. /* The envelope defines a function of time returning Fixed values.  It's
  55.  * used to scale the nominal volume specified in the Voice8Header.    */
  56.  
  57. #define ID_BODY MakeID('B', 'O', 'D', 'Y')
  58.  
  59. /* BODY chunk contains a BYTE[], array of audio data samples. */
  60.  
  61.  
  62.